package com.ruibang.glass.produce.mapper;

import com.ruibang.glass.common.domain.quality.HotGlassDefectNum;
import com.ruibang.glass.produce.domain.resp.OperateHotQualityInfo;
import com.ruibang.glass.produce.domain.resp.OperateQualityDefectInfo;
import com.ruibang.glass.produce.entity.OperateQuality;
import com.ruibang.glass.produce.entity.ProduceColdCleanRoomRecord;
import com.ruibang.glass.produce.entity.ProduceCost;
import com.ruibang.glass.produce.entity.SaleStatistics;
import com.teaming.cloud.framework2.autoconfigure.dynamic.datasource.annotation.DS;
import com.teaming.cloud.framework2.autoconfigure.mybatisplus.mapper.CommonMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-04-08  16:20
 * @Description: TODO
 * @Version: 1.0
 */

@Mapper
public interface ProduceOperateMapper extends CommonMapper<ProduceCost> {

    @DS("hot2_bc2mes")
    OperateHotQualityInfo getOperateHotQualityInfo(@Param("start") long start, @Param("end") long end);

    OperateQuality getOperateQualityInfo(@Param("startTime") LocalDateTime startTime, @Param("endTime")LocalDateTime endTime);

    List<OperateQualityDefectInfo> getZtDefect(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<OperateQualityDefectInfo> getSbtDefect(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<OperateQualityDefectInfo> getZqxDefect(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<OperateQualityDefectInfo> getCpftDefect(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
    @DS("hot2_bc2mes")
    int getHotGhDiscardBoardNum(@Param("start") long start, @Param("end") long end);

    HotGlassDefectNum getHotPzDefectDiscardBoardNum(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    @DS("hot2_bc2mes")
    int getHotQtDefectDiscardBoardNum(@Param("start") long start, @Param("end") long end);

    int getMonthSbLpNum(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    OperateQuality queryOperateQuality(@Param("recordDate") String recordDate);

    ProduceCost queryProduceCost(@Param("recordDate") String recordDate);

    SaleStatistics querySaleStatistics(@Param("recordDate") String recordDate);
}
